package com.xiye.zuul;

import com.xiye.zuul.filter.AccessUserFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

/**
 * @Package com.xiye.zuul
 * @Description 网关
 * @Author 西野
 * @Date 2018-07-11
 * @Version V1.0
 */
@EnableEurekaClient
@EnableZuulProxy
@EnableHystrixDashboard
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class XiyeZuulApplication {

    public static void main(String[] args) {
        SpringApplication.run(XiyeZuulApplication.class, args);
    }

    /*
     * @Author 西野
     * @Date 2018-06-21 16:06:06
     * @Description 增加拦截器
     * @Param []
     * @Return com.xiye.zuul.filter.AccessUserFilter
     */
    @Bean
    public AccessUserFilter accessUserFilter() {
        return new AccessUserFilter();
    }
}
